package com.jufa_3.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class ChargeRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String openId;

    private String chargeName;

    private String keyWord;

    private Float cost;

    //返回类型
//    @DateTimeFormat(pattern ="yyyy-MM-dd hh:mm:ss")
    //接收类型
//    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime chargeTime;

    private String payCombo;

    private String payComboBalance;

    // 微信付费
    public ChargeRecord(String openId, String chargeName, String keyWord, Float cost) {
        this.openId = openId;
        this.chargeName = chargeName;
        this.keyWord = keyWord;
        this.cost = cost;
        this.chargeTime = LocalDateTime.now();
    }

}
